import 'package:flutter/material.dart';
import 'package:grint/constant/colors.dart';

enum TextType { miSans, rubik }

class MyText extends StatelessWidget {
  const MyText({
    super.key,
    required this.text,
    required this.type,
    this.fontSize = 16,
    this.color = AppColors.textGrey,
    this.fontWeight = FontWeight.w400,
    this.textAlign = TextAlign.left,
    this.overflow = TextOverflow.ellipsis,
    this.maxLines = 1,
    this.decoration = TextDecoration.none,
  });

  final String text;
  final TextType type;
  final double fontSize;
  final Color color;
  final FontWeight fontWeight;
  final TextAlign textAlign;
  final TextOverflow overflow;
  final int? maxLines;
  final TextDecoration decoration;

  @override
  Widget build(BuildContext context) {
    return Text(
      text,
      style: TextStyle(
        fontSize: fontSize,
        color: color,
        fontWeight: fontWeight,
        decoration: decoration,
        fontFamily: type == TextType.miSans ? 'MiSans Latin' : 'Rubik One',
        overflow: overflow,
      ),
      textAlign: textAlign,
      maxLines: maxLines,
    );
  }
}
